import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Phone from '../views/Phone/index.vue'
import Computer from '../views/Computer/index.vue'
import PhoneDetail from '../components/PhoneDetail.vue'
import Compare from '../views/Compare/index.vue'
import EarPhone from '../views/EarPhone/index.vue'
import Pad from '../views/Pad/index.vue'
import More from '../views/Phone/more.vue'
import Detail from '../components/ProductDetail.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'phone',
    component: Phone
  },
  {
    path: '/computer',
    name: 'computer',
    component: Computer
  },
  {
    path: '/earphone',
    name: 'earphone',
    component: EarPhone
  }, {
    path: '/pad',
    name: 'pad',
    component: Pad
  },
  {
    path: '/more',
    name: 'PhoneMore',
    component: More
  },
  {
    path: '/detail',
    name: 'Detail',
    component: Detail
  },
  {
    path: '/compare',
    name: 'Compare',
    component: Compare
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  scrollBehavior() {
    return {
      x: 0,
      y: 0
    }
  }
})

export default router